#include <iostream>
using namespace std;

class A
{
  public:
    int x;

    A(int x1)
    {
        x = x1;
        cout << "A" << endl;
    }
};

class B
{
  public:
    int x;

    explicit B(int x1)
    {
        x = x1;
        cout << "B" << endl;
    }
};

void f1(A a)
{
}
void f2(B b)
{
}

int main()
{
    f1(10);    //输出A
    f2(B(20)); //输出B
    // f2(20);    //编译出错，提示conversion from `int' to non-scalar type `B' requested
}